﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
using ServiceProcess.Helpers;

[assembly: log4net.Config.XmlConfigurator(Watch = true)]

namespace Organizer.Server
{
    static class Program
    {
        private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            log.Trace(System.Reflection.MethodBase.GetCurrentMethod().Name + " called");

            try
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[] 
                { 
                    new Service() 
                };

                //ServiceBase.Run(ServicesToRun);
                ServicesToRun.LoadServices();
            }
            catch (Exception e)
            {
                log.Fatal("Uncaught Exception", e);
                throw e;
            }
        }
    }
}
